﻿namespace lcwb.Shared.Service
{
    // CourseNavigationState.cs
    public class CourseStateService
    {
        private int? _currentCourseId;
        public int? CurrentCourseId
        {
            get => _currentCourseId;
            set
            {
                if (_currentCourseId != value)
                {
                    _currentCourseId = value;
                    OnStateChange?.Invoke();
                }
            }
        }

        private int? _currentChapterId;
        public int? CurrentChapterId
        {
            get => _currentChapterId;
            set
            {
                if (_currentChapterId != value)
                {
                    _currentChapterId = value;
                    OnStateChange?.Invoke();
                }
            }
        }

        public event Action? OnStateChange;
    }
}
